
import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
import store from './store';
//1.引入ElementPlus组件库
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import axios from "axios";
//3.引入ElementPlus图标库
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
//5.1修改elementPlus默认中文
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
const app = createApp(App)
//4.遍历ElementPlusIconsVue图标库，并将所有图标组件依次注册到vue实例app中
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
//2. .use(ElementPlus)给当前vue实例应用ElementPlus组件库
//5.2 app.use(ElementPlus,{ locale: zhCn })将El本地化为中文
app.use(ElementPlus,{ locale: zhCn }).use(store).use(router).mount('#app')

app.config.productionTip = false;

window.getUser =()=>{
    return localStorage.user?JSON.parse(localStorage.user):null;
}
//定义一个全局的localhost
const  BASEURL='http://localhost:8080'
window.BASEURL=BASEURL;